import { defineStore } from 'pinia'

const useStudentInfoStore = defineStore('studentInfo', {
    state: () => ({
        accountId: "",
        cardno: "",
        cname: "",
        deptid: "",
        email: "",
        empno: "",
        ename: "",
        fullname: "",
        gender: "",
        gradelevel: 0,
        sid: "",
        sourcetype: "",
        status: "",
    }),
    actions: {
        setInfo(user) {
            this.cname = user.cname
            this.accountId = user.accountID
            this.cardno = user.cardno
            this.deptid = user.deptid
            this.email = user.email
            this.empno = user.empno
            this.ename = user.ename
            this.fullname = user.fullname
            this.gender = user.gender
            this.gradelevel = user.gradelevel
            this.sid = user.sid
            this.sourcetype = user.sourcetype
            this.status = user.status
        },
    },

    persist: {
        enabled: true
    }
})

export default useStudentInfoStore